<!DOCTYPE html>
<html lang="en">
<head>
    <{include file="header.html"}>
    <title>科目管理-<{$user_data['school_name']}>-德安信会计在线教育平台</title>
</head>
<body>
<div class="wrap">
    <!--star left-->
    <div class="column">
        <{include file="left_menu.html"}>
    </div>
    <div id="ContMianBox">
        <!--star子栏目-->
        <div class="sub-colum">
            <div class="tit"><{$left_menu_min.menu}></div>
            <ul>
                <{foreach from=$left_menu_min.list item=item}>
                <li <{if $item['url'] == $left_menu_min.curr}>class="curr"<{/if}>><a href="<{$item['url']}>"><{$item['name']}></a></li>
                <{/foreach}>
            </ul>
        </div>
        <!--end子栏目-->
        <!--end left-->
        <div class="container narrow">
            <!--star conter-->
            <div class="cetContent">
                <div class="tit p-lr20">
                    <span><a href="/subject">科目管理</a></span>
                    <span class="curr"><a href="/subject/chapter_list">章节管理</a></span>
                </div>
                <!--star内容区域-->
                <div class="mainScroll">
                    <div class="mainContainer line-all">
                        <!--star tabMainCont-->
                        <div class="tabMainCont">
                            <!--star会员管理-->
                            <fieldset class="layui-elem-field">
                                <legend>按条件搜索</legend>
                                <div class="layui-field-box">
                                    <form class="layui-form layui-form-pane1" method="post" action="/subject/chapter_list">
                                        <div class="layui-form-item">
                                            <div class="layui-inline">
                                                <select name="subject_id" id="subject" lay-filter="subject">
                                                    <option value="0">请选择科目</option>
                                                    <{foreach from=$subject_list item=sitem}>
                                                        <option value="<{$sitem.id}>" <{if isset($conditions.subject_id) AND $conditions.subject_id == $sitem.id}>selected<{/if}>><{$sitem.title}></option>
                                                    <{/foreach}>
                                                </select>
                                            </div>

                                            <div class="layui-inline">
                                                <input type="text" name="title" placeholder="章节名称" value="<{if !empty($conditions['title']) }><{$conditions['title']}><{/if}>" class="layui-input">
                                            </div>

                                            <div class="layui-inline">
                                                <button type="submit" class="layui-btn">搜索</button>
                                                <a class="layui-btn" href="/subject/add_chapter"><i class="layui-icon"></i> 添加章节</a>
                                            </div>
                                        </div>
                                    </form>
                                </div>
                            </fieldset>
                            <form class="layui-form layui-form-pane1" method="post" action="/subject/update_sort" delete_action="/subject/delete_chapter">
                                <table class="layui-table" lay-even lay-skin="row">
                                    <thead>
                                        <tr>
                                            <th>ID</th>
                                            <th>所属科目</th>
                                            <th>所属章</th>
                                            <th>章节名称</th>
                                            <th>排序</th>
                                            <th>操作</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                    <{foreach from=$chapter_list item=item}>
                                        <tr>
                                            <td class="center">
                                                <input type="checkbox" name="ids[]" value="<{$item['id']}>" title="<{$item['id']}>">
                                            </td>
                                            <td class="center"><{$item['sub_title']}></td>
                                            <td class="center"><{$item['top_title']}></td>
                                            <td class="center"><{$item['title']}></td>
                                            <td class="center">
                                            <input style="width:40px;" name="sort[<{$item['id']}>]" maxlength="4" type="text" value="<{$item['sort']}>" onkeyup="this.value=this.value.replace(/\D/g,'')" onafterpaste="this.value=this.value.replace(/\D/g,'')">
                                            </td>
                                            <td class="center">
                                                <a class="layui-btn layui-btn-primary layui-btn-small" href="/subject/edit_chapter/<{$item['id']}>" target="_blank"><i class="layui-icon"></i></a>
                                                <a class="layui-btn layui-btn-primary layui-btn-small delete_data" href="/subject/delete_chapter/<{$item['id']}>"><i class="layui-icon"></i></a>
                                            </td>
                                        </tr>
                                    <{/foreach}>
                                    <{if $chapter_list|count eq 0}>
                                        <tr>
                                            <td class="center" style=" height:120px; text-align:center;line-height:120px;" colspan="8">
                                                赞无数据！
                                            </td>
                                        </tr>
                                    <{/if}>
                                    <tr>
                                        <td class="center" colspan="7">
                                            <input type="checkbox" lay-filter="checkbox_all" title="全选">
                                            <button id="delete" class="layui-btn layui-btn-primary layui-btn-small" ><i class="layui-icon"></i> 批量删除</button>
                                            <input type="submit" class="layui-btn layui-btn-primary layui-btn-small" name="" value="更新排序">
                                        </td>
                                    </tr>
                                    </tbody>
                                </table>
                            </form>
                            <div class="pages p-tb20" style="text-align:right;">
                                <{$pagination}>
                            </div>
                        </div>
                        <!--star会员管理-->
                    </div>
                        <!--end tabMainCont-->
                </div>
            </div>
        </div>
    </div>
</div>
<{include file="footer.html"}>
</body>
</html>